<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ page import="com.hzqy.commons.utils.ConstantUtils" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>保洁修改</title>
<link rel="stylesheet" type="text/css"	href="../static/js/themes/defalut.css">
<link rel="stylesheet" type="text/css"	href="../static/js/themes/public.css">
<link rel="stylesheet" type="text/css"	href="../static/js/themes/ddspstyle.css">
<link rel="stylesheet" type="text/css"	href="../static/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"	href="../static/js/themes/icon.css">
<link rel="stylesheet" type="text/css"	href="../static/js/WdatePicker/skin/WdatePicker.css">
<script type="text/javascript" src="../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../static/js/jquery.easyui.min.js"></script>
<script type="text/javascript"	src="../static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../static/js/jquery.validate.js"></script>
<script type="text/javascript" src="../static/js/index.js"></script>
<script type="text/javascript" src="../static/js/WdatePicker/WdatePicker.js"></script>
<script type="text/javascript" charset="utf-8" src="../ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../ueditor/lang/zh-cn/zh-cn.js"></script>


<link href="../static/stream/css/stream-v1.css" rel="stylesheet" type="text/css">
<link href="../static/bootstrap-3.3.5/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="../static/stream/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../static/stream/js/stream-v1.js"></script>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<%
	String para =request.getParameter("f_cc_id");
	int f_cc_id = 0;
	if(para != null)
		f_cc_id = Integer.valueOf(para);
	
	String img_url = session.getServletContext().getInitParameter("img_url");
	String []nonceObj=ConstantUtils.getNonceObject();
%>
<script type="text/javascript">
	var ids = "";
	var transfer_video_file_path = '';
	$(function() {
		var img_url = '<%=img_url%>';
		var f_cc_id = <%=f_cc_id%>;
		window.stream_upload_content_id = f_cc_id;
		$.ajax({
			url:"select_content.do?f_cc_id="+f_cc_id,
			success:function(data) {
				data = JSON.parse(data);
				$("#f_cc_id").val(data.f_cc_id);
				$("#f_cc_code").val(data.f_cc_code);
				$("#f_cc_name").val(data.f_cc_name);
				$("#f_cc_company_id").val(data.f_cc_companyid);
				ids = data.f_cc_companyid;
				$("#f_cc_company_name").val(data.f_cc_companyname);
				$("#f_cc_searchname").val(data.f_cc_searchname);
				$("#f_cc_tags").val(data.f_cc_tags);
				$("#f_cc_type").val(data.f_cc_type);
				$("#f_cc_desc").val(data.f_cc_desc);
				$("#f_cc_onlinedate").val(data.f_cc_onlinedate.substring(0,19));
				$("#f_cc_offlinedate").val(data.f_cc_offlinedate.substring(0,19));
				$("#f_cc_director").val(data.f_cc_director);
				$("#f_cc_obligate1").val(data.f_cc_obligate1);
				$("#f_cc_obligate2").val(data.f_cc_obligate2);
				$("#f_cc_obligate3").val(data.f_cc_obligate3);
				$("#f_cc_obligate4").val(data.f_cc_obligate4);
				$("#f_cc_interfaceType").val(data.f_cc_interfaceType);
				$("#f_cc_definitionflag").val(data.f_cc_definitionflag);
				$("#f_cc_mediacode").val(data.f_cc_mediacode);
				$("#f_cc_medioCommonFlag").val(data.f_cc_medioCommonFlag);
				$("#f_cc_transcodeStatus").val(data.f_cc_transcodeStatus);
			}
		});
		
		$("#contentForm").validate({
			rules: {
				f_cc_name: {
					required: true,
					maxlength: 50
				},
				f_cc_searchname:{
					required: true,
					maxlength: 50
				},
				f_cc_companyname: {
					required: true
				},
				f_cc_onlinedate: {
					required: true,
					date: true
				},
				f_cc_offlinedate: {
					required: true,
					date: true
				},
				f_cc_interfaceType:{
					required: true
				},
				f_cc_obligate1: {
					required: true,
				}
				
			},
			messages: {
				f_cc_name: {
					required: "请输入房间号",
					maxlength: "房间号不能超过50位"
				},
				f_cc_searchname:{
					required: "请输入机顶盒账号",
					maxlength: "机顶盒账号不能超过50位"
				},
				f_cc_companyname:{
					required: "请选择组织",
				},
				f_cc_onlinedate: {
					required: "请选择上线日期",
					date: "请输入正确的日期"
				},
				f_cc_offlinedate: {
					required: "请选择下线日期",
					date: "请输入正确的日期"
				},
				f_cc_interfaceType:{
					required: "请选择次数",
				},
				f_cc_obligate1: {
					required: "请选择保洁日期",
				}
			},
			
		});
		
	});

	function _gt(){
		$.ajax({
			url:"update_content_status.do?f_cc_id=<%=f_cc_id%>&f_cc_status=1",
			success:function(data) {
				data = JSON.parse(data);
				if (data.success) {
					$.messager.progress('close');
					$.messager.alert('提示', '提交成功！', 'info', function() {
						parent.$('#dlg').dialog('close');
						parent.gotoSearch($('#easyui-treegrid'));
					});
				} else {
					$.messager.alert('提示', data.result, 'info', function() {
						$.messager.progress('close');
					});
				}
			}
		});
	}
	
	function _btg(){
		$.ajax({
			url:"update_content_status.do?f_cc_id=<%=f_cc_id%>&f_cc_status=12",
			success:function(data) {
				data = JSON.parse(data);
				if (data.success) {
					$.messager.progress('close');
					$.messager.alert('提示', '提交成功！', 'info', function() {
						parent.$('#dlg').dialog('close');
						parent.gotoSearch($('#easyui-treegrid'));
					});
				} else {
					$.messager.alert('提示', data.result, 'info', function() {
						$.messager.progress('close');
					});
				}
			}
		});
	}
	
	function _submitFm() {
		if(ids!=$("#f_cc_company_id").val()){
			$("#status").val("change");
		}
		/* arrayToJson(); */
		if($("#contentForm").validate().form()) {
		app_ajax('update_content.do', $("#contentForm").serialize(), function(data) {
				if (data.success) {
					$.messager.progress('close');
					$.messager.alert('提示', '提交成功！', 'info', function() {
						parent.$('#dlg').dialog('close');
						parent.gotoSearch($('#easyui-treegrid'));
					});
				} else {
					$.messager.alert('提示', data.result, 'info', function() {
						$.messager.progress('close');
					});
				}
		});
	  }
	}
	
	var _open = true;
	
	function castSelect(id){
		openDialog($('#cast_list'),'content_cast.jsp?id='+id);
	}
	
	function bind(id) {
		openDialog($('#dlg'),'org_bind.jsp?f_cc_id='+id+'&chooseid='+$("#f_cc_company_id").val());
	}
	
	
	function uploadTransferVideo() {
		
	}

	function downloadTransferVideo() {
		window.open(transfer_video_file_path);
	}
</script>
</head>

<body class="overfwidth">
	<div class="barnavtop">您所在的位置：内容管理 &gt; 内容修改</div>
	<div id="workspace">
		<!--主体 开始-->
		<div id="container">
			<div class="editspace">
				<form id="contentForm" class="cmxform" enctype="multipart/form-data" name="formName">
					<input type="hidden" id="f_cc_id" name="f_cc_id" value="" />
					<input type="hidden" id="picJson" name="picJson" value="[]" />
					<input type="hidden" id="f_cc_status" name="f_cc_status" value="0"/>
					<input type="hidden" id="f_cast_id" name="f_cast_id" value="0"/>
					<input type="hidden" id="f_cc_isfree" name="f_cc_isfree" value="0"/>
					<input id="f_cc_type" name="f_cc_type" type="hidden" value="24">
					<input id="f_cc_transcodeStatus" name="f_cc_transcodeStatus" type="hidden" value="0">
					<input id="f_cc_obligate2" name="f_cc_obligate2" type="hidden" value="0">
					<input id="f_cc_onlinedate" name="f_cc_onlinedate" type="hidden" value="2019-01-11" />
					<input id="f_cc_offlinedate" name="f_cc_offlinedate" type="hidden" value="2019-01-11" />
					<input type="hidden" name="stime" value="<%=nonceObj[0]%>"/>
					<input type="hidden" name="sign" value="<%=nonceObj[1]%>"/>
					<legend>保洁时间修改</legend>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>房间号
									</td>
									<td width="30%">
										<input id="f_cc_name" name="f_cc_name" style="width: 150px;" value="" class="yl_inp yw_name" />
										<span id="f_cc_name_tip" class="tip"></span>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>机顶盒账户
									</td>
									<td width="30%">
										<input id="f_cc_searchname" name="f_cc_searchname" style="width: 150px;" value="" class="yl_inp yw_name" />
										<span id="f_cc_searchname" class="tip"></span>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>组织选择:
									</td>
									<td width="30%">
										<input name="f_cc_companyname" id="f_cc_company_name" readonly="readonly"	style="width: 150px;" value="" class="yl_inp yw_name" />
										<input name="f_cc_companyid" id="f_cc_company_id" type="hidden" value="" />  
										<input name="status" id="status" type="hidden" value="nochange" />  
										<!-- <select id="f_cc_companyid" name="f_cc_companyid" style="width: 150px;">
										</select> -->
										<!-- <span id="f_cc_companyid_tip" class="tip"></span> -->
										<a id="12" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0);"
											onclick="bind();">选择</a>
									</td>
									
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										第几次清扫：
									</td>
									<td width="30%">
										<select name="f_cc_interfaceType" id="f_cc_interfaceType" style="width: 150px;">
										<option value="1">第一次清扫</option>
										<option value="2">第二次清扫</option>
										</select>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										清扫星期：
									</td>
									<td width="30%">
										<select name="f_cc_obligate1" id="f_cc_obligate1" style="width: 150px;">
										<option value="星期日">星期日</option>
										<option value="星期一">星期一</option>
										<option value="星期二">星期二</option>
										<option value="星期三">星期三</option>
										<option value="星期四">星期四</option>
										<option value="星期五">星期五</option>
										<option value="星期六">星期六</option>
										</select>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<div class="toolbar" style="text-align: center;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
							href="javascript:void(0);" onclick="_submitFm()">保存</a> <a
							href="javascript:void(0);" data-options="iconCls:'icon-cancel'"
							class="easyui-linkbutton"
							onclick="javascript:parent.$('#dlg').dialog('close')">取消</a>
					</div>
				</form>
			</div>
			
		</div>
		<!--主体 结束-->
	</div>
	<div id="cast_list" class="easyui-dialog"
		style="width: 600px; height: 470px; padding-top: 0px;"
		data-options="title:'模型选择', iconCls:'icon-save',modal:true,closed:true,buttons:'#dlg_buttons'">
		<iframe scrolling="auto" frameborder="0"
			style="width: 100%; height: 99%;"></iframe>
	</div>
	<div id="dlg" class="easyui-dialog"
		style="width: 800px; height: 500px; padding-top: 0px;"
		data-options="title:'企业管理', iconCls:'icon-save',modal:true,closed:true,buttons:'#dlg_buttons'">
		<iframe scrolling="auto" frameborder="0"
			style="width: 100%; height: 99%;"></iframe>
	</div>
	
	</body>
</html>
